<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // includes()   判断是否包含  返回布尔值
        // indexOf()
        // lastIndexOf() 
        // concat()
        // slice()

        // toUpperCase()  转化大写
        // toLowerCase()  转化小写


        // substring(startIndex , endIndex)   ===  slice()
        // substr(index , howmany)   第二个参数是数量   



        var str = 'heLLo';
        console.log(str.includes('o'));
        console.log(str.indexOf('o'));
        console.log(str.concat('o'));
        console.log(str.slice(1, 3));
        console.log(str.substring(1, 3));
        console.log(str.substr(2, 3));

        console.log(str.toUpperCase());
        console.log(str.toLowerCase());

        var str1 = 'hEllo';
        var str2 = 'HeLlo1';

        // 如何让str1和str2相等   --- 可以都转小写或者同时转大写
        if (str1.toLowerCase() === str2.toLowerCase()) {
            alert('ok')
        }

    </script>

</body>

</html>